package org.budo.jdbc.driver.statement.impl;

import java.sql.PreparedStatement;
import java.sql.SQLException;
import java.util.Map;

import org.budo.jdbc.driver.AbstractBudoJdbcPreparedStatement;
import org.budo.jdbc.driver.resultset.impl.MapArrayResultSet;
import org.budo.jdbc.driver.statement.AbstractJdbcStatement;
import org.budo.support.lang.util.MapUtil;

/**
 * @author limingwei
 */
public class SELECT_ONE extends AbstractJdbcStatement {
    @Override
    public void execute(PreparedStatement preparedStatement) throws SQLException{
        String[] columnNames = new String[] { "1" };
        Map[] mapArray = new Map[] { MapUtil.stringMap("1", "1") };

        MapArrayResultSet resultSet = new MapArrayResultSet(columnNames, mapArray);
        ((AbstractBudoJdbcPreparedStatement) preparedStatement).setResultSet(resultSet);
    }
}
